package com.wn.consumer.feign;

import com.wn.bean.Order;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.stream.Collectors;

/**
 * <p>
 *  前端控制器
 * </p>
 * @author Yellow Docker
 * @since 2022-11-04
 */
@FeignClient(value = "order-prod",path = "order")
public interface OrderFeignClient {

    /**
     * 请求方式的url  @GetMapping("all")  不能省略
     * @PathVariable("id") 的参数不要省略
     * @return
     */
    @GetMapping("all")
    public List<Order> findOrders();

    @GetMapping("{id}")
    public Order findOrderById(@PathVariable("id")Integer id);

    @PostMapping
    public String addOrder(@RequestBody Order order);

}

